//
//  FixViewController.m
//  mhome
//
//  Created by 刘春雷 on 2018/11/29.
//  Copyright © 2018年 刘春雷. All rights reserved.
//

#import "FixViewController.h"

@interface FixViewController ()
@property(nonatomic,strong)UIScrollView *scroll;
@end

@implementation FixViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"安装工程";
    self.scroll = [[UIScrollView alloc]initWithFrame:CGRects(0, 0, 375, 667)];
    self.scroll.contentSize = CGSizeMake(0 , (667+160)*kHeightScale);
    self.scroll.backgroundColor = [UIColor whiteColor];
    self.scroll.pagingEnabled = NO;//是否允许整也翻
    self.scroll.bounces = NO;//关闭弹簧效果
    self.scroll.showsVerticalScrollIndicator = NO;//是否显示垂直滚动条
    [self.view addSubview:self.scroll];
    [self setUI];
}
- (void)setUI {
    UIImageView*headImage=[[UIImageView alloc] initWithFrame:CGRects(0, 0, 375, 135)];
    headImage.backgroundColor = [UIColor grayColor];
    headImage.image=[UIImage imageNamed:@"construct-ban"];
    [self.scroll addSubview:headImage];

    for(int i = 0; i< 2;i++){
        UILabel*title=[[UILabel alloc ] init];
        title.font=[UIFont systemFontOfSize:20.0*BIZ];//字体大小
        [self.scroll addSubview:title];
        UILabel*content=[[UILabel alloc] init];
        content.numberOfLines = 0;
        content.font=[UIFont systemFontOfSize:13.0*BIZ];//字体大小
        content.textColor=[UIColor grayColor];
        [self.scroll addSubview:content];
        UIImageView*imgOne=[[UIImageView alloc] init];
        [self.scroll addSubview:imgOne];
        if(i == 0){
            title.frame = CGRects(15, 170, 300, 30);
            title.text=@"卫浴安装";
            content.frame = CGRects(15, 200, 345, 100);
            content.text=  @" ● 卫浴柜应与墙面接触平整,浴镜与柜体安装对称。\n ● 抽屉及柜门开关灵活,无异响。\n ● 配套三角阀安装无松动、漏水等现象,排水管封闭牢固,无污水溢出。";
            imgOne.frame = CGRects(20, 300, 335, 140);
            imgOne.image=[UIImage imageNamed:@"fix1"];
        }else{
            title.frame = CGRects(15, 460, 300, 30);
            title.text=@"坐便器安装";
            content.frame = CGRects(15, 490, 345, 100);
            content.text= @" ● 擦拭干净坐便器底部排污口及地面下水孔。\n ● 将坐便器密封圈对准排污口并压紧。\n ● 座便器与排污管接口应用油脂法兰密封,外部用硅胶封边,严禁用水泥砂浆固定。";
            imgOne.frame = CGRects(20, 590, 335, 140);
            imgOne.image=[UIImage imageNamed:@"fix2"];
        }
        //改变label的间边距
        NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:content.text];
        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
        [paragraphStyle setLineSpacing:6];
        [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [content.text length])];
        content.attributedText = attributedString;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
